import request from '@/router/axios';

export const getList = (current, size, params) => {
  return request({
    url: '/api/smart-govsvc/citywork/myCityworkList',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}


export const getDetail = (workId) => {
  return request({
    url: '/api/smart-govsvc/citywork/detail',
    method: 'get',
    params: {
      workId
    }
  })
}

export const remove = (ids) => {
  return request({
    url: '/api/smart-govsvc/citywork/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}

export const add = (row) => {
  return request({
    url: '/api/smart-govsvc/citywork/submit',
    method: 'post',
    data: row
  })
}

export const update = (row) => {
  return request({
    url: '/api/smart-govsvc/citywork/submit',
    method: 'post',
    data: row
  })
}

export const finish = (ids) => {
  return request({
    url: '/api/smart-govsvc/citywork/finish',
    method: 'post',
    params: {
      ids,
    }
  })
}


export const allocationSave = (workId,deptId,assignOpinion) => {
  return request({
    url: '/api/smart-govsvc/citywork/allocationSave',
    method: 'post',
    params: {
      workId,
      deptId,
      assignOpinion
    }
  })
}

export const applyDelaySave = (form) => {
  return request({
    url: '/api/smart-govsvc/cityworkDelay/saveDelay',
    method: 'post',
    data: form
  })
}

export const assignSave = (workId,dealUser) => {
  return request({
    url: '/api/smart-govsvc/citywork/assignSave',
    method: 'post',
    params: {
      workId,
      dealUser
    }
  })
}

export const getReplayDetail = (workId) => {
  return request({
    url: '/api/smart-govsvc/citywork/replayDetail',
    method: 'get',
    params: {
      workId
    }
  })
}
//保存回复
export const replaySave = (params) => {
  return request({
    url: '/api/smart-govsvc/citywork/replaySave',
    method: 'post',
    data: params
  })
}

//延期回退保存
export const backTimeSave = (params) => {
   return request({
     url: 'api/smart-govsvc/cityworkBacktimeout/save',
     method: 'post',
     data: params
   })
}

//分配部门列表
export const getToDeptList = () => {
  return request({
    url: '/api/smart-system/dept/getDeptList',
    method: 'get',
    params: {
      
    }
  })
}
//驳回操作页面详情查询
export const getRejectDetail = (workId) => {
  return request({
    url: '/api/smart-govsvc/citywork/rejectDetail',
    method: 'get',
    params: {
      workId
    }
  })
}

//保存驳回
export const rejectSave = (params) => {
  return request({
    url: '/api/smart-govsvc/citywork/rejectSave',
    method: 'post',
    data: params
  })
}

//历史单列表
export const getOldOrderList = (workId) => {
  return request({
    url: '/api/smart-govsvc/cityworkOld/selectOldListByWorkId',
    method: 'get',
    params: {
      workId
    }
  })
}

//保存驳回
export const hastenSave = (params) => {
  return request({
    url: '/api/smart-govsvc/citywork/hastenSave',
    method: 'post',
    data: params
  })
}

export const shuffle = (ids) => {
  return request({
    url: '/api/smart-govsvc/citywork/shuffle',
    method: 'post',
    params: {
      ids,
    }
  })
}



